/*
var belong;
belong=objController;
inventory_menu_show=true;
inventory_menu_line=1;
inventory_menu_location_x=w-10-slotx;
inventory_menu_location_y=yy+10;
inventory_menu_size=slotx;
*/

var xx,yy,w,h;
xx=inventory_x-hudburn;
yy=inventory_y-hudburn;
w=inventory_w+hudburn;
h=inventory_h+hudburn;

var perc,slotx,sloty;
perc=math_percentage_match(55,w-xx);
slotx=perc/4;
sloty=perc/8;

if (inventory_menu==true && inventory_dialog==true)
{
var a,b,c,d;
a=item_info_menu1(inventory_item_id(inventory_menu_line));
b=item_info_menu2(inventory_item_id(inventory_menu_line));
c=item_info_menu3(inventory_item_id(inventory_menu_line));
d=item_info_menu4(inventory_item_id(inventory_menu_line));

draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_set_color(c_black);
if (a!=-1 or 0) ///4th Slot but 1.Dialog
{
draw_sprite_stretched(sprInventoryFormButton,0,w-10-slotx,yy+30+(sloty*2),slotx,sloty);
draw_text(w-10-(slotx/2),yy+30+((sloty*2)+sloty/2),item_info_dialogname(a));
}

if (b!=-1 or 0) ///3th Slot but 2.Dialog
{
draw_sprite_stretched(sprInventoryFormButton,0,w-20-(slotx*2),yy+30+(sloty*2),slotx,sloty);
draw_text(w-20-((slotx*2)-slotx/2),yy+30+((sloty*2)+sloty/2),item_info_dialogname(b));
}

if (c!=-1 or 0)
{
draw_sprite_stretched(sprInventoryFormButton,0,w-30-(slotx*3),yy+30+(sloty*2),slotx,sloty);
draw_text(w-30-((slotx*3)-slotx/2),yy+30+((sloty*2)+sloty/2),item_info_dialogname(c));
}

if (d!=-1 or 0)
{
draw_sprite_stretched(sprInventoryFormButton,0,w-40-(slotx*4),yy+30+(sloty*2),slotx,sloty);
draw_text(w-40-((slotx*4)-slotx/2),yy+30+((sloty*2)+sloty/2),item_info_dialogname(d));
}
draw_set_halign(fa_left);
draw_set_valign(fa_top);
}

draw_set_font(fontInventory);
draw_set_color(c_yellow);
draw_set_halign(fa_right);
var itemid;
itemid=inventory_item_id(inventory_menu_line);
draw_text(w-10,yy+30+((sloty*2)+sloty/2)+(sloty/2),item_info_title(itemid));
draw_set_color(c_red);
draw_text_ext(w-10,yy+30+((sloty*2)+sloty/2)+(sloty/2)+(font_get_size(fontInventory)*2),item_info_description(itemid),-1,w-40-(slotx*4));


















